{template Public:Page:header}
<div class="container">
  <div class="row"> 
  {template Member:Index:sidebar}
    <div class="col-lg-10 well-col-pl-30">
      <div class="row">
        <div class="well">
          <h3>个人信息</h3>
          <hr />
          

          <form data-bv-feedbackicons-validating="glyphicon glyphicon-refresh" data-bv-feedbackicons-invalid="glyphicon glyphicon-remove" data-bv-feedbackicons-valid="glyphicon glyphicon-ok" class="form-horizontal bv-form" method="post" id="Form" novalidate="novalidate">
          
          <div class="form-group has-feedback">
            <label class="col-lg-2 control-label">当前头像：</label>
            <div class="col-lg-5"> 
           	 <p>
               {echo GetAvatarSimple($uid,120)}
               </p>
               <p>
               <a class="btn btn-primary btn-sm" href="{echo U('/member/avatar')}">更新头像</a>
               </p>
            </div>
          </div>
        
      	<div class="form-group has-feedback">
               <label class="col-lg-2 control-label">店铺名称：</label>
               <div class="col-lg-5"> 
             	<input type="text" name="shopname" value="{if !empty($member['shopname'])}{echo $member['shopname']}{/if}" class="form-control">
               </div>
        </div>  
        
       <div class="form-group has-feedback">
               <label class="col-lg-2 control-label">店铺分类：</label>
               <div class="col-lg-5"> 
                <div class="btn-group">
                 <a href="javascript:void(0);" class="btn btn-default" id="CategoryNanme">{if !empty($member['category_name_1'])}{if $member['category_name_3']}{echo $member['category_name_3']} > {/if}{echo $member['category_name_2']} > {echo $member['category_name_1']}{else}请选择分类{/if}</a>
                 <a href="javascript:void(0);" data-toggle="dropdown" class="btn btn-default  dropdown-toggle"><i class="fa fa-angle-down"></i></a>
                 <ul class="dropdown-menu" id="FuwuCategory" style="z-index:1001"></ul>
                 </div>
               </div>
        </div>  
        
        
		<div class="form-group has-feedback">
               <label class="col-lg-2 control-label">性 别：</label>
               <div class="col-lg-5"> 
                <select name="gender">
               		 <option value="0" {if $member['gender']==0} selected="selected"{/if}>保密</option>
                  	<option value="1" {if $member['gender']==1} selected="selected"{/if}>男</option>
                    <option value="2" {if $member['gender']==2} selected="selected"{/if}>女</option>
                </select>
 
               </div>
        </div>  
          
           <div class="form-group has-feedback">
            <label class="col-lg-2 control-label">生 日：</label>
            <div class="col-lg-5"> 
           <select name="Year" id="SetYear">
        {echo $GetYear}
    </select>
    
    <select name="Month" id="SetMonth">
    
         {echo $GetMonth}
       
    </select>
    
    <select name="Day" id="SetDay">

    </select>
            </div>
          </div>
          
     	<div class="form-group has-feedback">
               <label class="col-lg-2 control-label">店铺简介：</label>
               <div class="col-lg-5"> 
             	<textarea rows="5" class="form-control" name="about">{if !empty($member['about'])}{echo $member['about']}{/if}</textarea>
               </div>
        </div>  
           
		<div class="form-group has-feedback">
               <div class="col-lg-offset-2 col-lg-5">
               	<button class="btn btn-success" type="submit">保 存</button>
               </div>
            </div>

          <input type="hidden" name="datatype" value="json"/>
          <input type="hidden" name="Submit" value="true"/>
          <input type="hidden" name="catid" id="Catid" value="{if !empty($member['catid'])}{echo $member['catid']}{/if}"/>
          
          </form>
          
        </div>
      </div>
    </div>
  </div>
</div>



<script src="{echo AURL}/js/validation/bootstrapValidator.js"></script>

<!--Bootstrap Date Picker-->
<script src="{echo AURL}/js/datetime/bootstrap-datepicker-{echo C('DEFAULT_LANG')}.js"></script>
<script>

        $(document).ready(function () {

		SetFormCategory(AURL+"/js/foxphp_json_task_category.js",'#FuwuCategory');
		
		   $('.date-picker').datepicker();

 		  $('#Form').bootstrapValidator({
                excluded: [':disabled'],
                feedbackIcons: {
                    valid: 'glyphicon glyphicon-ok',
                    invalid: 'glyphicon glyphicon-remove',
                    validating: 'glyphicon glyphicon-refresh'
                },
				fields: {
					shopname: {
						validators: {
							notEmpty: {
								message: '请输入店铺名称！'
							},
							stringLength: {
								min: 2,
								max: 30,
								message: '输入店铺名称最少2字符最多30字符！'
							}
						}
					},
					about: {
						validators: {
							notEmpty: {
								message: '请输入店铺简介'
							},
							stringLength: {
								min: 2,
								max: 200,
								message: '输入店铺简介最少2字符最多200字符！'
							}
						}
					}
				},
                submitHandler: function (form) {
			
				  $.post('{echo U("/post/member/info")}',$("#Form").serialize(), function(json) {
					
					  	$('.bootbox').PhpappProgress({json:json});

				 		return true;
					
				  }, 'json');
				  

				 bootbox.dialog({
					 message: '<div class="progress progress-striped active"><div style="width: 1%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="20" role="progressbar" class="progress-bar progress-bar-info"><span>0%</span></div></div>',
					 title: '<i class="icon fa fa-retweet"></i> 提交中',
					 closeButton: false
				 }).PhpappProgress({time:2000});
			 
				  return false; 
				 
                } 
			
            }) 

        });
	   

$(function(){	
		   
	 $("#SetMonth").change( function () {
									
		    GetDay();
								  
	 });
		   

});


function GetDay() {
	
	         var  Year=$("#SetYear").val();
			 
			 var  Month=$("#SetMonth").val();
			 
			 var dayarr='';
			 
			 var date= new Date(Year,Month,0);
			 
			 var Day=date.getDate();
			 
			 for(var i=1;i<=Day;i++){
				 
				 if('{echo $day}'==i){
					  var dayselected=' selected="selected"';
				 }else{
					  var dayselected='';
				 }
				 
				 dayarr+='<option value="'+i+'"'+dayselected+'>'+i+'</option>';
				   
			 }
			
			 
			 $("#SetDay").html(dayarr);
	
}

GetDay();

</script>
{template Public:Page:footer}